{include file="layout/layout" /}
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>商品管理</h3>
                <h5>网站系统商户索引与管理</h5>
            </div>
        </div>
    </div>
    <!-- 操作说明 -->
    <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 100%; height: 100%;">
        <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span title="收起提示" id="explanationZoom" style="display: block;"></span>
        </div>
        <ul>
            <li>平台可以强制下架商家违规的产品，对于商家发布的商品需要审核.</li>
            <li>上架，当商品处于非上架状态时，前台将不能浏览该商品，店主可控制商品上架状态</li>
            <li>违规下架，当商品处于违规下架状态时，前台将不能购买该商品，只有管理员可控制商品违规下架状态，并且商品只有重新编辑后才能上架</li>
        </ul>
    </div>
    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
                <h3>商品列表</h3>
                <h5>(共<span id="user_count">{$count}</span>条记录)</h5>
            </div>
            <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
            <!--搜索-->
            <div class="sDiv">
            	<form action="?act=s" method='post'>
                <div class="sDiv2">
                    <input type="text" name='name' id="search_key" size="30" class="qsbox" placeholder="请输入商品名称">
                    <input type="submit" class="btn" value="搜索">
                </div>
            	</form>
            </div>
        </div>
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0">
                <thead>
                    <tr>
                        <th class="sign" axis="col0">
                            <div style="width: 24px;"><i class="ico-check"></i></div>
                        </th>
                        <th align="left" abbr="user_id" axis="col3" class="">
                            <div style="text-align: center; width: 40px;" class="">商品ID</div>
                        </th>
                        <th align="left" abbr="nickname" axis="col4" class="">
                            <div style="text-align: center; width: 100px;" class="">商品名称</div>
                        </th>
                        <th align="center" abbr="level" axis="col5" class="">
                            <div style="text-align: center; width: 80px;" class="">商品分类</div>
                        </th>
                        <th align="center" abbr="total_amount" axis="col6" class="">
                            <div style="text-align: center; width: 80px;" class="">商品价格</div>
                        </th>
                        <th align="center" abbr="email" axis="col6" class="">
                            <div style="text-align: center; width: 60px;" class="">商品状态</div>
                        </th>
                        <th align="center" abbr="email" axis="col6" class="">
                            <div style="text-align: center; width: 60px;" class="">审核状态</div>
                        </th>
                        <th align="center" axis="col6" class="">
                            <div style="text-align: center; width: 80px;" class="">店铺名称</div>
                        </th>
                        <th align="center" abbr="reg_time" axis="col6" class="">
                            <div style="text-align: center; width: 120px;" class="">上架时间</div>
                        </th>
                        <th align="center" abbr="pay_points" axis="col6" class="">
                            <div style="text-align: center; width: 120px;" class="">添加时间</div>
                        </th>
                        <th align="center" axis="col1" class="handle">
                            <div style="text-align: center; width: 100px;">操作</div>
                        </th>
                        <th style="width:100%" axis="col7">
                            <div></div>
                        </th>
                    </tr>
                </thead>
                </table>
            </div>
        </div>
        <div class="tDiv">
            <div class="tDiv2">
            <div class="fbutton">
                <div title="导出商品" class="add">
                <a href="?act=ep" style="color:#0ba4da;"><span><i class="fa fa-share"></i>导出商品</span></a>
                </div>
            </div>
            </div>
            <div style="clear:both"></div>
        </div>
        <div class="bDiv" style="height: auto;" id="ajax_return">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
            <table>
            <tbody>
            {foreach $goods_list as $k=>$v}
            <tr data-id="2592" id="del{$v.gd_id}">
                    <td class="sign">
                        <div style="width: 24px;"><i class="ico-check"></i></div>
                    </td>
                    <td class="" align="left">
                        <div style="text-align: center; width: 40px;">{$v.gd_id}</div>
                    </td>
                    <td class="" align="left">
                        <div style="text-align: center; width: 100px;">{$v.gd_name}</div>
                    </td>
                    <td class="" align="left">
                        <div style="text-align: center; width: 80px;">{$v.sg_name}</div>
                    </td>
                    <td class="" align="left">
                        <div style="text-align: center; width: 80px;">{$v.gd_price/100} 元</div>
                    </td>
                    <td class="" align="left">
                        <div style="text-align: center; width: 60px;" id="s_{$v.gd_id}">{$v.gd_status}</div>
                    </td>
                    <td class="" align="left">
                        <div style="text-align: center; width: 60px;">{$v.gd_audit}</div>
                    </td>
                    <td class="" align="left">
                        <div style="text-align: center; width: 80px;">{$v.sp_name}</div>
                    </td>
                    <td class="" align="left">
                        <div style="text-align: center; width: 120px;">{$v.gd_sale_time}</div>
                    </td>
                    <td class="" align="left">
                        <div style="text-align: center; width: 120px;">{$v.gd_create_time}</div>
                    </td>
                    <td class="handle" align="center">
                        <div style="text-align: center; width: 150px; max-width:250px;">
                            <a class="btn blue" href="goodsDetail?id={$v.gd_id}"><i class="fa fa-pencil-square-o"></i>详情</a>
                            <a class="btn blue" href="goodsUpd?id={$v.gd_id}"><i class="fa fa-search"></i>编辑</a>
                            <a class="btn red" href="#" data-id="2592" onclick="return ajaxDel({$v.gd_id})"><i class="fa fa-trash-o"></i>删除</a>
                        </div>
                    </td>
                    <td class="" style="width: 100%;" align="">
                        <div>&nbsp;</div>
                    </td>
                </tr>    
            {/foreach}   
            </tbody>
            </table>
            </div>
        </div>
        <!--分页位置-->
        <center>{$page|raw}</center>
    </div>
</div>
<script>
    // ajax删除 status=2
    function ajaxDel(id){
        if(confirm('确认要删除该商品吗？')){
            $.get('goodsAjax',{'id':id},function(res){
                if(res){
                    $('#del'+id).remove();
                    alert('删除成功！');
                }else{
                    alert('删除失败！');
                }
            })
        }else{
            return false;
        }
    }
</script>
</body>
</html>